<?php

namespace co2\dev\v0_0_0\SVN;

use co2\dev\v0_0_0 as api;

class export extends api\bash

{
  const
    E_DESTINATION_DIRECTORY_EXISTS    = 1
    ;
    
  protected
    $errors=array
    (
      1
      =>'/svn: Destination directory exists;/'
    );
    
  public function
  __construct
  (
    $link,
    $target=null
  )
  
  {
    $this->cmd='svn export '.$link;
    
    if(!is_null($target))
    $this->cmd.=' '.$target;
    
    $this->exec(new api\RegEx('/Exported revision \d+|Export complete/'));
  }
}
